{include file='public/head' t='列表'}

<body>
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 订单列表</strong> <a href=""
                style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
            <form id="F" action="">
                <ul class="search" style="padding-left:10px;">
                    <li>搜索：</li>
                    <li>
                        {volist name='status' id='v'} {$v.order_status} : <input type="checkbox" name="statuss[]" id=""
                            {if isset($statuss) && in_array($v.status_id,$statuss)} checked {/if}
                            value="{$v.status_id}"> {/volist}
                    </li>
                    <li>
                        时间查询
                    </li>
                    <li>
                        前:<input type="date" name="timeq" value="{$timeq|default=''}"> 后:
                        <input type="date" name="timeh" value="{timeh|default=''}">
                    </li>
                    <li>订单金额</li>
                    <li>
                        前: <input type="number" name="prq" value="{$prq|default=''}"> 后: <input type="number" name="prh"
                            value="{$prh|default=''}">
                    </li>

                    <li>
                        <input type="text" placeholder="请输入搜索关键字" name="keywords" value="{$keywords|default=''}"
                            class="input" style="width:250px; line-height:17px;display:inline-block" />
                        <a href="javascript:F.submit();" class="button border-main icon-search"> 搜索</a>
                    </li>
                </ul>
            </form>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">ID</th>
                <th width="10%">用户</th>
                <th width="10%">价格</th>
                <th width="15%">状态</th>
                <th width="20%">下单时间</th>
                <th width="20%">备注</th>
                <th width="310">操作</th>
            </tr>
            {volist name='list' id='user'}
            <tr>
                <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="{$user.id}" />
                    {$user.id}
                </td>
                <td>{$user.uname}</td>
                <td>{$user.amount}</td>
                <td>
                    <font color="{in name='$user.status' value='0,10,11'}
                                red
                                {else /}
                                #00CC99
                                {/in}">
                        {$user.order_status}
                    </font>
                </td>
                <td>{$user.addtime|date='Y-m-d H-i-s'}</td>
                <td>{$user.remark}</td>
                <td>
                    <div class="button-group">
                        <a class="button border-main" href="{:url('Order/orderDetail')}">
                            <span class="icon-edit"></span> 查看</a>
                        <a class="button border-red" href="javascript:void(0)" onclick="return del(1,1,1)">
                            <span class="icon-trash-o"></span> 删除</a>
                    </div>
                </td>
            </tr>
            {/volist}
            <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall" /> 全选
            </td>
            <td colspan="7" style="text-align:left;padding-left:20px;">
                <a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;"
                    onclick="DelSelect()"> 删除</a>
            </td>
            </tr>
            <tr>
                <td colspan="8">
                    <!-- <div class="pagelist">
                        <!--                <a href="">上一页</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一页</a><a href="">尾页</a>-->

                    <!-- </div> -->
                    {$list|raw}
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        //搜索
        function changesearch() {

        }

        //单个删除
        function del(id, mid, iscid) {
            if (confirm("您确定要删除吗?")) {

            }
        }

        //全选
        $("#checkall").click(function () {
            $("input[name='id[]']").each(function () {
                if (this.checked) {
                    this.checked = false;
                } else {
                    this.checked = true;
                }
            });
        })

        //批量删除
        function DelSelect() {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {
                var t = confirm("您确认要删除选中的内容吗？");
                if (t == false) return false;
                $("#listform").submit();
            } else {
                alert("请选择您要删除的内容!");
                return false;
            }
        }

        //批量排序
        function sorts() {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {

                $("#listform").submit();
            } else {
                alert("请选择要操作的内容!");
                return false;
            }
        }


        //批量首页显示
        function changeishome(o) {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {

                $("#listform").submit();
            } else {
                alert("请选择要操作的内容!");

                return false;
            }
        }

        //批量推荐
        function changeisvouch(o) {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {


                $("#listform").submit();
            } else {
                alert("请选择要操作的内容!");

                return false;
            }
        }

        //批量置顶
        function changeistop(o) {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {

                $("#listform").submit();
            } else {
                alert("请选择要操作的内容!");

                return false;
            }
        }


        //批量移动
        function changecate(o) {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {

                $("#listform").submit();
            } else {
                alert("请选择要操作的内容!");

                return false;
            }
        }

        //批量复制
        function changecopy(o) {
            var Checkbox = false;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    Checkbox = true;
                }
            });
            if (Checkbox) {
                var i = 0;
                $("input[name='id[]']").each(function () {
                    if (this.checked == true) {
                        i++;
                    }
                });
                if (i > 1) {
                    alert("只能选择一条信息!");
                    $(o).find("option:first").prop("selected", "selected");
                } else {

                    $("#listform").submit();
                }
            } else {
                alert("请选择要复制的内容!");
                $(o).find("option:first").prop("selected", "selected");
                return false;
            }
        }
    </script>
</body>

</html>